#include <iostream>

namespace bga
{

template< typename T>
Tree<T>::Tree()
{

}

template< typename T>
Tree<T>::~Tree()
{

}

template< typename T>
Node<T>& Tree<T>::getRoot()
{
    return this->root;
}

template< typename T>
void Tree<T>::setRoot(Node<T>& root)
{
    /// check if root is valid, i.e his parent is null
    if (root.getParent() != NULL)
    {
        std::cout << "Warning in Tree<T>::setRoot : root has a parent." << std::endl;
    }

    this->root = root;
}

template< typename T>
DepthFirstTreeIterator<T> Tree<T>::getDepthFirstIterator() const
{
    DepthFirstTreeIterator<T> iterator(this->root);
    return iterator;
}

template< typename T>
void Tree<T>::addNodeListener(const NodeListener& nodeListener)
{
    this->root.addNodeListener(nodeListener, true);
}

}
